Skip to content

NUT-Monitor: share one Python implementation across PyQt5 and PyQt6 - #3596

Open
user01010111 wants to merge 2 commits into
networkupstools:masterfrom
user01010111:scripts/nut-monitor-pyqt-consolidation
Open

NUT-Monitor: share one Python implementation across PyQt5 and PyQt6#3596
user01010111 wants to merge 2 commits into
networkupstools:masterfrom
user01010111:scripts/nut-monitor-pyqt-consolidation

Conversation

@user01010111

Copy link
Copy Markdown

Summary

Closes #3589.

This replaces the separate PyQt5 and PyQt6 NUT-Monitor sources with one
shared Python 3 template. Autotools still generates the existing
NUT-Monitor-py3qt5 and NUT-Monitor-py3qt6 commands, so installed
command and resource names remain unchanged.

The dispatcher continues to prefer PyQt6 and fall back to PyQt5. It now
also accepts NUT_MONITOR_QT=5 or NUT_MONITOR_QT=6 when a particular
backend is required.

The shared reconnect path also corrects the existing authentication-widget
lookup. Both generated commands now recover an authenticated TLS connection
after the tested server-loss/restart sequence without the previous callback
exception and process abort.

The change adds focused dispatcher coverage and updates the build recipes,
manual page, configuration documentation, READMEs and NEWS entry.

Validation

  • git diff --check: passed.
  • make distcheck-light SPELLCHECK_ERROR_FATAL=no: passed archive generation,
    extracted-tree configure/build/check, install/uninstall and re-dist.
  • Dispatcher checks passed for PyQt5-only, PyQt6-only, both, neither, Python 2
    preference and fallback, explicit Qt5/Qt6 selection, automatic Qt6
    preference and invalid selection handling.
  • Both generated commands passed native GUI tests against a disposable NUT
    server, covering unauthenticated and authenticated connections, TLS 1.3,
    tray and notification behaviour, favourite persistence, writable-variable
    updates with server readback, and an authenticated instant command.
  • Forced automatic reconnect passed with both PyQt5 and PyQt6. After stopping
    upsd and restarting it 1.2 seconds later, each command reconnected to the
    selected UPS, restored authenticated writable-variable access and resumed
    TLS 1.3 without an exception or process abort.
  • Staged install/uninstall, generated shebangs, permissions and command names
    passed.
  • Desktop-file, manual-page and gettext/message-catalogue checks passed.

Python 2/GTK2 runtime and native Windows/macOS validation were unavailable.
The Python 2 implementation and platform package-facing command names are
unchanged.

AI assistance

OpenAI Codex gpt-5.6-sol was used by the controller and a delegated
high-reasoning implementation and validation worker. The human contributor
reviewed and validated the change and remains responsible for its content.

Generate the PyQt5 and PyQt6 commands from one Python 3 template while
preserving their installed names and backend-specific behaviour.

Let the dispatcher prefer PyQt6 by default and support NUT_MONITOR_QT=5
or NUT_MONITOR_QT=6 for explicit selection. Add focused dispatcher
coverage and update the build recipes and documentation.

Fix the existing authenticated automatic-reconnect callback to read its
authentication widget through the parent interface. This prevents the
unhandled timer callback exception that aborted both PyQt bindings.

OpenAI Codex gpt-5.6-sol assisted with implementation and validation.
The delegated worker used high reasoning. The human contributor reviewed
and validated the change and remains responsible for it.

Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

A ZIP file with standard source tarball and another tarball with pre-built docs for commit ad33a49 is temporarily available: NUT-tarballs-PR-3596.zip.

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.5156-master completed (commit bd15d205fd by @)

@jimklimov jimklimov added enhancement packaging python portability We want NUT to build and run everywhere possible labels Aug 31, 2026
@jimklimov jimklimov added this to the 2.8.6 milestone Aug 31, 2026
@jimklimov jimklimov added the AI For good or bad, machine tools are upon us. Humans are still the responsible ones. label Aug 31, 2026

@jimklimov jimklimov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplification looks great, but maybe there is a bit more to it becoming perfect.

Comment thread scripts/python/Makefile.am
Comment thread NEWS.adoc Outdated
Comment thread scripts/python/app/NUT-Monitor-py3qt.in
Comment thread scripts/python/app/NUT-Monitor-py3qt.in
Name the shared Qt template variable consistently, document how configure generates the two legacy command names, and record version 2.2.0. Link the NEWS entry to PR networkupstools#3596.

OpenAI Codex gpt-5.6-sol assisted with implementation and validation. The delegated worker used high reasoning. The human contributor reviewed and validated the change and remains responsible for it.

Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
@user01010111
user01010111 requested a review from jimklimov August 31, 2026 21:00
@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.5170-master completed (commit 49d2bc4077 by @)

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.5170-master completed (commit 49d2bc4077 by @)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI For good or bad, machine tools are upon us. Humans are still the responsible ones. enhancement packaging portability We want NUT to build and run everywhere possible python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate the duplicated PyQt5 and PyQt6 NUT-Monitor implementations

3 participants